package com.yqya.springboot.pattern.strategy.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.yqya.springboot.pattern.strategy.biz.OrderService;
import com.yqya.springboot.pattern.strategy.dto.OrderDTO;

/**
 * 订单控制层
 *
 * @author Kevin
 * @date 2019-06-29
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @RequestMapping(value = "/handle", method = RequestMethod.POST)
    @ResponseBody
    public String handleOrder(@RequestBody OrderDTO dto) {
        String result = orderService.handle(dto);
        return result;
    }

}
